<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div>
  <h3>Hello Spring Cloud Alibaba</h3>
  <button onclick="doBrowser()">buy</button>
  <span id="result"></span>
</div>
<!--<script src="https://unpkg.com/axios/dist/axios.min.js"></script>-->
<script src="/js/axios.min.js"></script>
<script>
    function doBrowser(){
        //1.定义请求url
        let url = "http://localhost:9000/nacos/provider/echo/1"
        //2.发送ajax请求
        let span = document.getElementById("result");
        axios.get(url).then(function(result){
            console.log("then:{}",result);
            span.innerHTML = result.data;
        })
        .catch(function(error){
            console.log("catch:{}",error)

        })
    }
</script>
</body>
</html>